Skip to content

Unify battery and Mac mini stats dashboards - #21

Merged
EClinick merged 1 commit into
masterfrom
task/ec/unify-stats-dashboard
Aug 9, 2026
Merged

Unify battery and Mac mini stats dashboards#21
EClinick merged 1 commit into
masterfrom
task/ec/unify-stats-dashboard

Conversation

@EClinick

@EClinick EClinick commented Aug 2, 2026

Copy link
Copy Markdown
Owner

What changed

  • Route battery and Mac mini presentations through one StatsView root while preserving their mode-specific state and data loading.
  • Share the dashboard layout, title/header anatomy, app-table panes, titled columns, and reusable app-row rendering.
  • Add the Mac mini column treatment to battery Stats, including LIVE W, ENERGY / COST, and CPU TIME.
  • Preserve the range-tab customization that is now on master from Customize stats tabs and improve popover scrolling #22 by composing its shared controls inside the unified dashboard headers.
  • Add a development-only --show-stats launch path for deterministic visual verification.

Why

Battery and Mac mini Stats had evolved into separate page implementations. Sharing the structural components keeps their UI consistent without conflating their different data lifecycles: battery ranges retain battery-session and historical-energy coordination, while Mac mini retains server-power history and live-watts loading.

Integration with #22

PR #22 merged before this PR. This branch is now rebased directly onto that merge and retains its persistent tab customization and popover scrolling behavior. The only overlaps were the battery and Mac mini Stats headers; they now use this PR's shared dashboard structure with #22's shared range controls.

Verification

  • make test — 317 tests passed across 42 suites on the combined result
  • git diff --check
  • No unresolved review comments or conversation threads

Copilot AI review requested due to automatic review settings August 2, 2026 22:39
@vercel

vercel Bot commented Aug 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
website Ignored Ignored Preview Aug 9, 2026 8:15am

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the Stats UI so both battery Macs and Mac minis render through a single StatsView root while keeping their mode-specific data loading separate. It centralizes the shared window layout and app-table components to prevent future UI drift between device modes, and adds a dev-only --show-stats launch path for deterministic visual checks.

Changes:

  • Introduces shared Stats dashboard building blocks (layout, header anatomy, table header, and reusable app row).
  • Re-routes battery Stats and Mac mini Stats through a unified StatsView, while preserving separate data lifecycles (BatteryStatsDashboard vs MacMiniStatsDashboard).
  • Adds dev-only --show-stats launch behavior to open the appropriate Stats window for the current device mode.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Tests/JuiceTests/StatsDashboardComponentsTests.swift Adds coverage for shared column configuration, minimum sizes, and a basic render/bitmap sanity check for shared table components.
Tests/JuiceTests/MacMiniPowerRangeTests.swift Updates minimum-size assertion to reference the unified StatsView server minimum height.
Sources/Juice/Stats/StatsWindow.swift Updates window presenters to use the unified StatsView entry points and the new mode-specific minimum sizes.
Sources/Juice/Stats/StatsView.swift Implements the unified StatsView root and refactors battery Stats to use shared dashboard components and a reusable app row.
Sources/Juice/Stats/StatsDashboardComponents.swift Adds shared reusable dashboard layout/header/table components and a unified app row implementation.
Sources/Juice/Stats/MacMiniStatsView.swift Renames/refactors Mac mini Stats content to MacMiniStatsDashboard and adopts shared dashboard/table components.
Sources/Juice/JuiceApp.swift Adds --show-stats dev-only launch path and refactors model initialization to reuse the initial model instance when opening battery Stats.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@EClinick
EClinick changed the base branch from task/ec/app-energy-cost to master August 9, 2026 08:07
@EClinick
EClinick force-pushed the task/ec/unify-stats-dashboard branch from c771813 to 11ffbeb Compare August 9, 2026 08:08
@EClinick
EClinick force-pushed the task/ec/unify-stats-dashboard branch from 11ffbeb to db77809 Compare August 9, 2026 08:15
@EClinick
EClinick merged commit 7baca12 into master Aug 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants